export class MyPromise {
    callbacks = []
    constructor(fn) {
        fn(this._resolver.bind(this))
    }
    _resolver(value) {
        this.callbacks.forEach(cb => cb(value))
    }
    then(onFulFilled) {
        this.callbacks.push(onFulFilled)
    }
}